<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<button-counter></button-counter>
			<button-counter></button-counter>
			<!-- <ButtonCounter></ButtonCounter> -->
		</div>
		<template id='btn'>
			<button @click="counter++">点击{{counter}}</button>
			<a href="#">首页</a>
		</template>
		<script type="text/javascript">
			let vm = new Vue({
				el: '#app',
				components: {
					/* 'button-counter': {
						template: '<button @click="counter++">点击{{counter}}</button>',
						data: function() {
							console.log(this);
							return {
								counter: 0
							}
						}
					} */
					ButtonCounter: {
						template: '#btn',
						data: function() {
							console.log(this);
							return {
								counter: 0
							}
						}
					}
				}
				//数据
				// data: {},
				//方法
				// methods:{},
				//计算属性
				// computed:{},
				//监视属性
				// watch:{},
				//过滤器
				// filters:{},
				//自定义指令
				// directives:{}
			})
			console.log(vm);
		</script>
	</body>
</html>
